package enemies
{
	import flash.geom.Point;
	
	public class Slime extends Enemy
	{
		var speed = 1;
		
		var attack_range = 125;
		var attack_strength = .3;
		public function Slime(gH:GameHandler)
		{
			super(gH);
			game_handler = gH;
		}
		
		public function run(){
			if(get_distance_to_castle() > attack_range)
				move_towards_castle();
			else
				attack_castle();
			resize_me();
		}
		public function move_towards_castle(){
			var dir:Point = get_direction_of_castle();
			this.x += dir.x * speed;
			this.y += dir.y * speed;
			
		}
		public function attack_castle(){
			game_handler.mana_amount -= attack_strength;
		}
		
	}
}